//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.tool.btn;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.MouseEvent;
import javax.swing.JLabel;
import org.come.Frame.TrueFeedbackMainJframe;
import org.come.Frame.ZhuFrame;
import org.come.Jpanel.*;
import org.come.mouslisten.GoodsMouslisten;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.until.CutButtonImage;
import org.come.until.FormsManagement;
import org.come.until.Util;

public class TrueFeedbackBtn extends MoBanBtn {
    private int caozuo;
    private TrueFeedbackMainJpanel trueFeedbackMainJpanel;
    private TrueFeedbackScPanel trueFeedbackScPanel;
    private TrueFeedbackLotteyJPanel trueFeedbackLotteyJPanel;
    private AthChartJPanel athChartJPanel;
    private LotteryJpanel lotteryJpanel;

    public TrueFeedbackBtn(String iconpath, int type, int caozuo, TrueFeedbackMainJpanel trueFeedbackMainJpanel) {
        super(iconpath, type);
        this.trueFeedbackMainJpanel = trueFeedbackMainJpanel;
        this.caozuo = caozuo;
    } 

    public TrueFeedbackBtn(String iconpath, int type, int caozuo, TrueFeedbackScPanel trueFeedbackScPanel) {
        super(iconpath, type);
        this.trueFeedbackScPanel = trueFeedbackScPanel;
        this.caozuo = caozuo;
    }

    public TrueFeedbackBtn(String iconpath, int type, int caozuo, String text, Color[] colors, Font font, TrueFeedbackScPanel trueFeedbackScPanel) {
        super(iconpath, type, colors);
        this.setText(text);
        this.setFont(font);
        this.setHorizontalTextPosition(0);
        this.setVerticalTextPosition(0);
        this.trueFeedbackScPanel = trueFeedbackScPanel;
        this.caozuo = caozuo;
    }

    public TrueFeedbackBtn(String iconpath, int type, int caozuo, String text, Color[] colors, Font font, TrueFeedbackLotteyJPanel trueFeedbackLotteyJPanel) {
        super(iconpath, type, colors);
        this.setText(text);
        this.setFont(font);
        this.setHorizontalTextPosition(0);
        this.setVerticalTextPosition(0);
        this.trueFeedbackLotteyJPanel = trueFeedbackLotteyJPanel;
        this.caozuo = caozuo;
    }

    public TrueFeedbackBtn(String iconpath, int type, int caozuo, String text, Color[] colors, Font font, AthChartJPanel athChartJPanel) {
        super(iconpath, type, colors);
        this.setText(text);
        this.setFont(font);
        this.setHorizontalTextPosition(0);
        this.setVerticalTextPosition(0);
        this.athChartJPanel = athChartJPanel;
        this.caozuo = caozuo;
    }
    public TrueFeedbackBtn(String iconpath, int type, int caozuo, String text, Color[] colors, Font font, LotteryJpanel lotteryJpanel) {
        super(iconpath, type, colors);
        this.setText(text);
        this.setFont(font);
        this.setHorizontalTextPosition(0);
        this.setVerticalTextPosition(0);
        this.lotteryJpanel = lotteryJpanel;
        this.caozuo = caozuo;
    }
	public void chooseyes() {
    }

    @Override
    public void chooseno() {
    }

    @Override
    public void nochoose(MouseEvent e) {
        try {
            if (this.caozuo == 0) {
                this.trueFeedbackMainJpanel.getBtnAddRecharge().setIcons(CutButtonImage.cuts("skin/8100226/button/B318.png"));
                this.trueFeedbackMainJpanel.getBtntimeSummon().setIcons(CutButtonImage.cuts("skin/8100226/button/B321.png"));
                this.trueFeedbackMainJpanel.getBtnLottey().setIcons(CutButtonImage.cuts("skin/8100226/button/B319.png"));
                this.trueFeedbackMainJpanel.getTrueFeedbackCardJPanel().changeShowView(this.caozuo);
                this.sendMes("0");
            } else if (this.caozuo == 1) {
                this.trueFeedbackMainJpanel.getBtnAddRecharge().setIcons(CutButtonImage.cuts("skin/8100226/button/B317.png"));
                this.trueFeedbackMainJpanel.getBtntimeSummon().setIcons(CutButtonImage.cuts("skin/8100226/button/B322.png"));
                this.trueFeedbackMainJpanel.getBtnLottey().setIcons(CutButtonImage.cuts("skin/8100226/button/B319.png"));
                this.trueFeedbackMainJpanel.getTrueFeedbackCardJPanel().changeShowView(this.caozuo);
                this.sendMes("1");
            } else if (this.caozuo == 2) {
                this.trueFeedbackMainJpanel.getBtnAddRecharge().setIcons(CutButtonImage.cuts("skin/8100226/button/B317.png"));
                this.trueFeedbackMainJpanel.getBtntimeSummon().setIcons(CutButtonImage.cuts("skin/8100226/button/B321.png"));
                this.trueFeedbackMainJpanel.getBtnLottey().setIcons(CutButtonImage.cuts("skin/8100226/button/B320.png"));
                this.trueFeedbackMainJpanel.getTrueFeedbackCardJPanel().changeShowView(this.caozuo);
                this.sendMes("2");
            } else {
                int num;
                if (this.caozuo == 3) {
                    if (this.trueFeedbackScPanel.getPage() <= 1) {
                        ZhuFrame.getZhuJpanel().addPrompt2("已经是首页了");
                        return;
                    }

                    this.trueFeedbackScPanel.setPage(1);
                    num = TrueFeedbackMainJframe.getTrueFeedbackMainJframe().getTrueFeedbackMainJpanel().getTrueFeedbackCardJPanel().getTypeMenu();
                    this.trueFeedbackScPanel.addData(num);
                } else if (this.caozuo == 4) {
                    if (this.trueFeedbackScPanel.getPage() <= 1) {
                        ZhuFrame.getZhuJpanel().addPrompt2("已经是首页了");
                        return;
                    }

                    this.trueFeedbackScPanel.setPage(this.trueFeedbackScPanel.getPage() - 1);
                    num = TrueFeedbackMainJframe.getTrueFeedbackMainJframe().getTrueFeedbackMainJpanel().getTrueFeedbackCardJPanel().getTypeMenu();
                    this.trueFeedbackScPanel.addData(num);
                } else if (this.caozuo == 5) {
                    if (this.trueFeedbackScPanel.getPage() >= this.trueFeedbackScPanel.getMaxPage()) {
                        ZhuFrame.getZhuJpanel().addPrompt2("已经是末页了");
                        return;
                    }

                    this.trueFeedbackScPanel.setPage(this.trueFeedbackScPanel.getPage() + 1);
                    num = TrueFeedbackMainJframe.getTrueFeedbackMainJframe().getTrueFeedbackMainJpanel().getTrueFeedbackCardJPanel().getTypeMenu();
                    this.trueFeedbackScPanel.addData(num);
                } else if (this.caozuo == 6) {
                    if (this.trueFeedbackScPanel.getPage() >= this.trueFeedbackScPanel.getMaxPage()) {
                        ZhuFrame.getZhuJpanel().addPrompt2("已经是末页了");
                        return;
                    }

                    this.trueFeedbackScPanel.setPage(this.trueFeedbackScPanel.getMaxPage());
                    num = TrueFeedbackMainJframe.getTrueFeedbackMainJframe().getTrueFeedbackMainJpanel().getTrueFeedbackCardJPanel().getTypeMenu();
                    this.trueFeedbackScPanel.addData(num);
                } else if (this.caozuo == 7) {
                    FormsManagement.HiddenDisplay(110);
                } else if (this.caozuo == 8) {
                    this.sendMes(String.valueOf(10 + TrueFeedbackMainJframe.getTrueFeedbackMainJframe().getTrueFeedbackMainJpanel().getTrueFeedbackCardJPanel().getTypeMenu()));
                } else if (this.caozuo == 9) {
                	num = this.trueFeedbackLotteyJPanel.getNum();
                    if (num != 0) {
                        ZhuFrame.getZhuJpanel().addPrompt2("抽奖还没有结束");
                        return;
                    }

                    int rank = this.trueFeedbackLotteyJPanel.getRank();
                    JLabel labRank = this.trueFeedbackLotteyJPanel.getLabRank();
                    if (rank <= 0) {
                        ZhuFrame.getZhuJpanel().addPrompt2("抽奖次数不足");
                        return;
                    }

                    --rank;
                    this.trueFeedbackLotteyJPanel.setRank(rank);
                    labRank.setText(String.valueOf(rank));
                    this.sendMes("12");
                }else if (this.caozuo == 100) {
                	num = this.athChartJPanel.getNum();
                    if (num != 0) {
                        ZhuFrame.getZhuJpanel().addPrompt2("抽奖还没有结束");
                        return;
                    }
                    this.sendMes("13");
                }else if (this.caozuo == 101) {
                    if (lotteryJpanel.isLotteyIn()) {
                        ZhuFrame.getZhuJpanel().addPrompt2("抽奖还没有结束");
                        return;
                    }
                    this.sendMes("13");
                }
            }
        } catch (Exception var5) {
            var5.printStackTrace();
        }

    }

    public void goCJ() {
    	num = this.athChartJPanel.getNum();
        if (num != 0) {
            ZhuFrame.getZhuJpanel().addPrompt2("抽奖还没有结束");
            return;
        }
        this.sendMes("13");
    }
    
    public void sendMes(String type) {
        String sendmes = Agreement.getAgreement().laborAgreement(type);
        SendMessageUntil.toServer(sendmes);
    }
}
